<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <input type="text" class="user">
    <input type="text" class="pwd">
    <button>登录</button>


    <script src="../js/promise_ajax.js"></script>
    <script src="../js/api_v2.js"></script>
    <script>

        const oUser = document.querySelector('.user');
        const oPwd = document.querySelector('.pwd');
        const oBtn = document.querySelector('button');
        oBtn.addEventListener('click', async function () {
            const username = oUser.value;
            const password = oPwd.value;

            // 请求数据  
            const res = await login({ username, password });
            console.log(res);

        })




    </script>

</body>

</html>